﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Liger.Web.Common;
using Liger.Web.Common.Extensions;

namespace Liger.Web.UI
{
    public class DragBuilder : UIComponentBuilderBase, IHideObjectMembers
    {
        private Drag Drag
        {
            get
            {
                return this.Component as Drag;
            }
        }


        public DragBuilder()
            : base(new Drag())
        {

        }

        public DragBuilder(Drag Drag)
            : base(Drag)
        {

        }

        /// <summary>
        /// 设置属性
        /// </summary>
        /// <param name="property"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        public DragBuilder Set(string property, object value)
        {
            if (this.Drag.Properties.ContainsKey(property))
            {
                this.Drag.Properties[property] = value;
            }
            else
            {
                this.Drag.Properties.Add(property, value);
            }
            return this;
        }

        /// <summary>
        /// 返回ligerDrag的Manager
        /// </summary>
        /// <param name="manager">manager的对象名</param>
        /// <returns></returns>
        public DragBuilder Manager(string manager)
        {
            this.Drag.Manager = manager;
            return this;
        }


        public DragBuilder Handler(string value)
        {
            this.Drag.Handler = value;
            return this;
        }
        public DragBuilder Proxy(bool value)
        {
            this.Drag.Proxy = value;
            return this;
        }
        public DragBuilder Revert(bool value)
        {
            this.Drag.Revert = value;
            return this;
        }
        public DragBuilder Animate(bool value)
        {
            this.Drag.Animate = value;
            return this;
        }
        public DragBuilder Receive(string value)
        {
            this.Drag.Receive = value;
            return this;
        }
        public DragBuilder Disabled(bool value)
        {
            this.Drag.Disabled = value;
            return this;
        }
        public DragBuilder ProxyX(string value)
        {
            this.Drag.ProxyX = value;
            return this;
        }
        public DragBuilder ProxyY(string value)
        {
            this.Drag.ProxyY = value;
            return this;
        }
    }
}